Fastreport inside components execpt Exeption. Delphi 7.0
Dear...,
I implemented the Fastreport-components inside another (comp.blp).
requires
...
frx7,
fs7,
fqb70,
frxe7;
This new component is used at different positions (*.dll) inside the projects.
The applications is running, no problem.
By closing the application all modules (*.dll) will destroy. The Result: Access violation at.... [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> The Fastreport is used over a pointer of an object. I'm testing, that the pointer is <> nil.[/img][img]style_emoticons/<#EMO_DIR#>/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" /> I've gotten this probleme, in the moment of implementation of frx7, fs7, fqb70, frxe7 (requires....) inside comp.bpl. (Only: Use.... and Require....) Are there some ideas?[/img]
I implemented the Fastreport-components inside another (comp.blp).
requires
...
frx7,
fs7,
fqb70,
frxe7;
This new component is used at different positions (*.dll) inside the projects.
The applications is running, no problem.
By closing the application all modules (*.dll) will destroy. The Result: Access violation at.... [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> The Fastreport is used over a pointer of an object. I'm testing, that the pointer is <> nil.[/img][img]style_emoticons/<#EMO_DIR#>/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" /> I've gotten this probleme, in the moment of implementation of frx7, fs7, fqb70, frxe7 (requires....) inside comp.bpl. (Only: Use.... and Require....) Are there some ideas?[/img]
Comments
Perhaps your FR-Component is destroyed at another point (Owner Component Destroy) already but your pointer is not cleared there.
Try: In OnDestroy of your FR-Component set your global pointer to nil.
Is allready done. Wasn't the probleme.
At the posisition of exception, there is an module=nil. But without FR this module isn't nil, also if I don't use FR in different modules.
At the moment I use a "headache tablet" means if(mod<>nil) then....
What I'm looking for is die reasone of the problem.
Codelines:
if Count > 0 then begin
while ix < Count do begin
moddef := Items[ix] ;
if(moddef<>nil) then begin
if moddef.Instance = hinst then begin
result := moddef.Name ;
Exit ;
end ;
end;
Inc ( ix ) ;
end
...
An possible explaination: Different modules use the pointer of the allocated globel member of the FR-Container. At the application finishing every modules will destroy. The first module finds the FR by the pointer, so that FR will also destroy. At the destroying of the second module, the FR is missing and .... access violation.
Now, I use the headache tablet...